#include "audiocaptureinput.h"
#include "AudioCaptureImpl.h"
#include "Receive_handler.h"
AudioCaptureInput::AudioCaptureInput()
{
    m_handler       = 0;
    m_oAudioCaptureImpl = new AudioCaptureImpl;
}

AudioCaptureInput::~AudioCaptureInput()
{
    delete m_oAudioCaptureImpl;
}

bool AudioCaptureInput::start(Receive_handler* phandler, unsigned int SamplesRate)
{
    m_handler       = phandler;
	return m_oAudioCaptureImpl->open(this, SamplesRate);
}

void AudioCaptureInput::stop()
{
    m_oAudioCaptureImpl->close();
    m_handler       = 0;;
}

void AudioCaptureInput::receive_data(const char *data, int len)
{
    if(m_handler)
       m_handler->receive_handler(data,len);
}

